home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
xecho11.zip
/
SETFX.BAT
< prev
next >
Wrap
DOS Batch File
|
1989-02-11
|
8KB
|
269 lines
echo off
rem SETFX.BAT: send control codes to epson "FX" type printer
rem
rem run SETFX (without options) for a help screen
rem
if "%1"=="" goto help
for %%p in (help HELP) do if "%1"=="%%p" goto help
goto keyword
:next
shift
:keyword
if "%1"=="" goto exit
for %%p in (no NO) do if "%1"=="%%p" goto no
for %%p in (initial INITIAL) do if "%1"=="%%p" goto init
for %%p in (init INIT) do if "%1"=="%%p" goto init
for %%p in (cpi CPI) do if "%1"=="%%p" goto cpi
for %%p in (cpi10 CPI10 10) do if "%1"=="%%p" goto cpi10
for %%p in (cpi12 CPI12 12) do if "%1"=="%%p" goto cpi12
for %%p in (cpi17 CPI17 17) do if "%1"=="%%p" goto cpi17
for %%p in (cpi20 CPI20 20) do if "%1"=="%%p" goto cpi20
for %%p in (lpi LPI) do if "%1"=="%%p" goto lpi
for %%p in (lpi6 LPI6 6) do if "%1"=="%%p" goto lpi6
for %%p in (lpi8 LPI8 8) do if "%1"=="%%p" goto lpi8
for %%p in (draft DRAFT) do if "%1"=="%%p" goto draft
for %%p in (nlq NLQ) do if "%1"=="%%p" goto nlq
for %%p in (nonlq NONLQ) do if "%1"=="%%p" goto draft
for %%p in (wide WIDE) do if "%1"=="%%p" goto wide
for %%p in (nowide NOWIDE) do if "%1"=="%%p" goto nowide
for %%p in (emphasized EMPHASIZED) do if "%1"=="%%p" goto emph
for %%p in (noemphasized NOEMPHASIZED) do if "%1"=="%%p" goto noemph
for %%p in (thick THICK) do if "%1"=="%%p" goto thick
for %%p in (nothick NOTHICK) do if "%1"=="%%p" goto nothick
for %%p in (proportional PROPORTIONAL) do if "%1"=="%%p" goto prop
for %%p in (noproportional NOPROPORTIONAL) do if "%1"=="%%p" goto noprop
for %%p in (italic ITALIC italics ITALICS) do if "%1"=="%%p" goto italic
for %%p in (noitalic NOITALIC noitalics NOITALICS) do if "%1"=="%%p" goto noitalic
for %%p in (normal NORMAL) do if "%1"=="%%p" goto normal
for %%p in (uni UNI unidirectional UNIDIRECTIONAL) do if "%1"=="%%p" goto uni
for %%p in (bi BI bidirectional BIDIRECTIONAL) do if "%1"=="%%p" goto bi
for %%p in (margins MARGINS) do if "%1"=="%%p" goto margins
for %%p in (lm LM left LEFT) do if "%1"=="%%p" goto lm
for %%p in (rm RM right RIGHT) do if "%1"=="%%p" goto rm
for %%p in (tabs TABS) do if "%1"=="%%p" goto tabs
for %%p in (pl PL) do if "%1"=="%%p" goto pl
for %%p in (pll PLL) do if "%1"=="%%p" goto pll
for %%p in (pli PLI) do if "%1"=="%%p" goto pli
for %%p in (page PAGE) do if "%1"=="%%p" goto page
for %%p in (pagelength PAGELENGTH) do if "%1"=="%%p" goto pl2
for %%p in (tof TOF) do if "%1"=="%%p" goto tof
for %%p in (skip SKIP) do if "%1"=="%%p" goto skip
for %%p in (noskip NOSKIP) do if "%1"=="%%p" goto noskip
for %%p in (pos POS) do if "%1"=="%%p" goto skip
for %%p in (nopos NOPOS) do if "%1"=="%%p" goto noskip
echo ERROR: unrecognised parameter: %1
echo.
goto help
:no
for %%p in (nlq NLQ) do if "%1"=="%%p" goto draft
for %%p in (wide WIDE) do if "%1"=="%%p" goto nowide
for %%p in (emphasized EMPHASIZED) do if "%1"=="%%p" goto noemph
for %%p in (thick THICK) do if "%1"=="%%p" goto nothick
for %%p in (proportional PROPORTIONAL) do if "%1"=="%%p" goto noprop
for %%p in (italic ITALIC italics ITALICS) do if "%1"=="%%p" goto noitalic
for %%p in (skip SKIP) do if "%1"=="%%p" goto noskip
for %%p in (pos POS) do if "%1"=="%%p" goto noskip
echo ERROR: unrecognised parameter after NO: %1
echo.
goto help
:init
xecho \027@>prn
goto next
:cpi
shift
if "%1"=="10" goto cpi10
if "%1"=="12" goto cpi12
if "%1"=="17" goto cpi17
if "%1"=="20" goto cpi20
echo ERROR: illegal value specified: %1
echo (characters per inch not set)
goto next
:cpi10
xecho \018\027P>prn
goto next
:cpi12
xecho \018\027M>prn
goto next
:cpi17
xecho \027P\015>prn
goto next
:cpi20
xecho \027M\015>prn
goto next
:lpi
shift
if "%1"=="6" goto lpi6
if "%1"=="8" goto lpi8
echo ERROR: illegal value specified: %1
echo (lines per inch not set)
goto next
:lpi6
xecho \0272>prn
goto next
:lpi8
xecho \0270>prn
goto next
:draft
xecho \027x\0>prn
goto next
:nlq
xecho \027x\1>prn
goto next
:emph
xecho \027E>prn
goto next
:noemph
xecho \027F>prn
goto next
:thick
xecho \027G>prn
goto next
:thick
xecho \027H>prn
goto next
:wide
xecho \027W\1>prn
goto next
:nowide
xecho \027W\0>prn
goto next
:prop
xecho \027p\1>prn
goto next
:noprop
xecho \027p\0>prn
goto next
:italic
xecho \0274>prn
goto next
:noitalic
xecho \0275>prn
goto next
:normal
xecho \027F\027H\027p\0\027W\0\0275>prn
goto next
:uni
for %%p in (directional DIRECTIONAL) do if "%1"=="%%p" shift
xecho \027U\1>prn
goto next
:bi
for %%p in (directional DIRECTIONAL) do if "%1"=="%%p" shift
xecho \027U\0>prn
goto next
:margins
shift
xecho \027I\%1>prn
shift
xecho \027Q\%1>prn
goto next
:lm
shift
for %%p in (margin MARGIN) do if "%1"=="%%p" shift
xecho \027l\%1>prn
goto next
:rm
shift
for %%p in (margins MARGIN) do if "%1"=="%%p" shift
xecho \027Q\%1>prn
goto next
:tabs
set $t=
:tabs1
shift
if "%1"=="" goto tabs2
if "%1"=="0" goto tabs2
set $t=$t\%1
goto tabs1
:tabs2
xecho \027D%$t%\0>prn
set $t=
goto next
:pl
shift
goto pl2
:page
shift
for %%p in (length LENGTH) do if "%1"=="%%p" shift
:pl2
for %%p in (l L lines LINES) do if "%1"=="%%p" goto pll
for %%p in (i I inches INCHES) do if "%1"=="%%p" goto pli
goto pll2
:pll
shift
:pll2
xecho \027C\%1>prn
goto next
:pli
shift
:pli2
xecho \027C\0\%1>prn
goto next
:tof
echo TOF function is not available via software on this printer
goto next
:pos
xecho \0279>prn
goto next
:nopos
xecho \0278>prn
goto next
:skip
xecho \027N\2>prn
goto next
:noskip
xecho \027O>prn
goto next
:help
cls
echo Usage: SETFX param1 param2 ... where "params" can be:
echo.
echo INITIAL or INIT - sets printer to turn-on state
echo CPI10 or CPI 10 or 10 - set 10 cpi (chars per inch)
echo CPI12 or CPI 12 or 12 - set 12 cpi (not av. in NLQ)
echo CPI17 or CPI 17 or 17 - set 17 cpi (not av. in NLQ)
echo CPI20 or CPI 20 or 20 - set 20 cpi (not av. in NLQ)
echo LPI6 or LPI 6 or 6 - set 6 lpi (lines per inch)
echo LPI8 or LPI 8 or 8 - set 8 lpi
echo.
echo For the following, (NO) indicates that the function is disabled by
echo putting "NO" before the keyword (as two words or one).
echo.
echo DRAFT - set draft printing
echo (NO)NLQ - set NLQ printing ("NO NLQ" == "DRAFT")
echo (NO)EMPHASIZED - double print lines for darker chars
echo (NO)THICK - double print lines for thicker chars
echo (NO)WIDE - double width chars
echo (NO)PROPORTIONAL - emphasized, proportional printing
echo (NO)ITALIC or ITALICS - italic characters (not av. in NLQ)
echo NORMAL - cancel EMPHASIZED,THICK,WIDE,ITALIC,PROPOR.
echo UNI[DIRECTIONAL] - uni-directional printing
echo BI[DIRECTIONAL] - bi-directional printing
echo.
pause
cls
echo SETFX Usage Continued.
echo.
echo For the following "n" is a decimal number from 1 to 255. These
echo parameters must follow keywords as shown or results unpredictable.
echo Words in [...] are optional. Those shown joined to previous word
echo can also be separate words.
echo.
echo For margins, "n" are char posn; minimum and maximum depend on pitch.
echo For tabs, "n" are char posn; 0 to 32 values in ascending order may be
echo used and must be followed by a "0"; Use "TABS 0" to clear all tabs.
echo For page length, "n" can be 1 to 127 lines or 1 to 22 inches.
echo Setting page length also sets top-of-form.
echo.
echo MARGINS n n - set left and right margins (cancels tabs)
echo LEFT [MARGIN] or LM n - set left margin
echo RIGHT [MARGIN] or RM n - set right margin
echo TABS n n n ... 0 - set tab stops
echo.
echo PL[L or I] n - set page length in lines (or inches)
echo PAGE[LENGTH] [LINES or INCHES] n - set page length in lines (or inches)
echo TOF - set top of form (not available on FX)
echo (NO)SKIP -